<span class="msg" id="msgPrint">Náhled článku k tisku</span>
<span class="msg" id="msgExport">Export článku do PDF</span>
<span class="msg" id="msgEmail">Odeslání článku na emaily</span>

<div class="center">
<?
  $current = $_GET['current'];
  
  $query = mysql_query("SELECT count(*) as POCET FROM clanek");
  $fetch = MySQL_Fetch_Array($query);
  $rows = $fetch["POCET"];        //celkový počet článků v db
  
  $paginator = new Paginator(8, 3, $current, $rows, PAGE_NEWS, "");
  
  $query = getZpravy($paginator->getFirstPageIndex(), $paginator->getPageSubjects());
  while($fetch = MySQL_Fetch_Array($query)){
      $id_clanku = $fetch["ID_CLANKU"];
      
      $datum_vytvoreni = $fetch["CAS_VYTVORENI"];
      $datum_upravy = $fetch["CAS_UPRAVY"];
      
      if($datum_upravy != $datum_vytvoreni) $datum = "<strong>".DateFormat::format($datum_upravy, DF_DDMMYYYYHHMM)."</strong> aktualizoval ";
      else $datum = "<strong>".DateFormat::format($datum_vytvoreni, DF_DDMMYYYYHHMM)."</strong> vytvořil ";
      
      $nadpis = $fetch["NADPIS"];
      $komentaru = $fetch["komentaru"];
      $popis = $fetch["POPIS"];
      $autor = "<strong>".getUsername($fetch["ID_AUTOR"])."</strong> ";
      
      $link = redirect_str(PAGE_REPORT).add_par("id_clanku=".$id_clanku);
      
      require("./inc/email_modal.php");
      
      $comments_link = $link."#comments";
      if($komentaru == 0) $text_kom = "";
      else if($komentaru == 1) $text_kom = "(<a href='".$comments_link."'>1 komentář</a>)";
      else if($komentaru >= 2 && $komentaru <= 4) $text_kom = "(<a href='".$comments_link."'>".$komentaru." komentáře</a>)";
      else $text_kom = "(<a class='preloader' href='".$comments_link."'>".$komentaru." komentářů</a>)";
      
      echo "<div class='report-box' style='margin-bottom: 10px;'>";
        echo "<div class='header'>";
          	echo "<div style='float: left;'>".$datum.$autor.$text_kom."</div>";
          	echo "<div class='righted'>";
				echo "<a href='./print/clanek.php?id_clanku=".$id_clanku."' target='blank' onmouseover=\"MyTip('msgPrint', 'help')\" onmouseout='UnTip()'><img alt='Tisk' class='icon-btn' src='./img/icons/print.png' /></a>";
				echo "<a href='./print/export_pdf.php?id_clanku=".$id_clanku."' target='blank' onmouseover=\"MyTip('msgExport', 'help')\" onmouseout='UnTip()'><img alt='Export do PDF' class='icon-btn' src='./img/icons/file.png' /></a>";
				echo "<a onclick=\"popup_show('popup".$id_clanku."', 'popup_drag".$id_clanku."', 'popup_exit".$id_clanku."', 'screen-center',         0,   0);\" onmouseover=\"MyTip('msgEmail', 'help')\" onmouseout='UnTip()'><img alt='Poslat na email' class='icon-btn' src='./img/icons/email.png' /></a>";
			echo "</div>";
        echo "</div>";
        echo "<div class='body'>";
          echo "<div class='title'><a class='preloader' href='$link'>$nadpis</a></div>";
          if($popis != "") echo "<div class='content'>".$popis."</div>";
          echo "<div class='more'><a class='preloader' href='$link'>...čtěte více</a></div>";
        echo "</div>";
      echo "</div>";
  }
  
  $paginator->show();

?>
</div>
<?

?>